package com.upeoe.shiro.chapter5.service.impl;

import com.upeoe.shiro.chapter5.dao.RoleDao;
import com.upeoe.shiro.chapter5.dao.impl.RoleDaoImpl;
import com.upeoe.shiro.chapter5.entity.Role;
import com.upeoe.shiro.chapter5.service.RoleService;

/**
 * @author ven_hxz
 * @create 2016-07-05 下午2:49
 */
public class RoleServiceImpl implements RoleService {
    private RoleDao roleDao = new RoleDaoImpl();


    public Role createRole(Role role) {
        return roleDao.createRole(role);
    }

    public void deleteRole(Long roleId) {
        roleDao.deleteRole(roleId);
    }

    public void addRelationPermissions(Long roleId, Long... permissions) {
        roleDao.addRelationPermissions(roleId, permissions);
    }

    public void removeRelationPermissions(Long roleId, Long... permissions) {
        roleDao.removeRelationPermissions(roleId, permissions);
    }
}
